package com.object_.oriented_.extend_;

public class ExtendExercise01 {
    public static void main(String[] args) {
        B b = new B();
    }
}


class A {
    //无参构造
    A() {
        System.out.println("a");
    }

    //有参构造
    A(String name) {
        System.out.println("a name");
    }
}


class B extends A {
    B() {
        //无参构造器，有this 没有 super
        this("abc");
        System.out.println("b");
    }

    B(String name) {
        //会调用一个默认的super(); ，会调用主类的无参构造
        System.out.println("b name");
    }
}

